package com.wanmait.happyheating.service;

import com.github.pagehelper.PageInfo;
import com.wanmait.happyheating.pojo.Ordersinfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.sql.Timestamp;
import java.util.List;

/**
 * <p>
 * 订单详情表 服务类
 * </p>
 *
 * @author yuQianTao
 * @since 2021-05-13
 */
public interface OrdersinfoService extends IService<Ordersinfo> {
    List<Ordersinfo> findUserinfoAll();
    List<Ordersinfo> findWorkesById(Integer id);
    PageInfo<Ordersinfo> findUserOrderInfoByPage(Integer pageNum, Integer pageSize,Integer UserId);
    PageInfo<Ordersinfo>findWorkOrderInfoByPage(Integer PageNum,Integer PageSize,Integer Worke);
    Ordersinfo findById(Integer id);
    void update(Ordersinfo ordersinfo);
    void updateStateId(Ordersinfo ordersinfo);
    Ordersinfo findFirstOrderByEmptyWorker(Integer userinfoId);
    List<Ordersinfo>finndWorksByIdByOrdersinfoId(Integer id,Integer odersinfoId);
    List<Ordersinfo>hang(Integer id,Integer stateId);
    /**
     * 判断该订单是否已经被维修人员接单
     * @param orderId 目标订单的ID
     * @return 接单：true；未结单：false
     */
    Boolean checkOrderHasWorker(Integer orderId);

    /**
     * 向收到下单信息的维修人员发送一条删除这个订单的消息
     * @param ordersinfo 已经被维修人员接单的订单
     */
    void sendDeleteMesToWorkers(Ordersinfo ordersinfo);
}
